﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WaterEdit.aspx.cs" Inherits="StoragePeriod.Web.FoodTesting.WaterFood.WaterEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>水分含量测定</title>
    <link href="/Styles/MainStyle.css" rel="stylesheet" type="text/css" />
    <link href="/Scripts/artDialog/skins/default.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <style type="text/css">
        .TitleTabs{ width:100%; height:25px; border-bottom:1px solid #3bb9f3; margin:0px auto; padding-top:10px;}
        .TitleTabs li{float:left; width:100px; height:25px; line-height:25px; margin-left:10px;}
        .TitleTabs li a{ display:block; width:100px; height:24px; line-height:24px; border:1px solid #3bb9f3; border-bottom:0px; text-align:center; background-color:#b9eefe; color:#000; font-weight:600;}
        .TitleTabs .TabsOver{border-bottom:1px solid #fff; background-color:#fff; color:#f90;}
        .Mean{ float:left; font-size:12px; font-weight:600; color:#f90;}
    </style>
    <script type="text/javascript">
        //验证控件是否为空
        function IsNotNull() {
            var b = true;
            if ($("#MainContent_txt_content").val() == "") {
                b = false;
            }
            if ($("#MainContent_txt_buwei").val() == "") {
                b = false;
            }
            if ($("#MainContent_txt_m0").val() == "") {
                b = false;
            }
            if ($("#MainContent_txt_m1").val() == "") {
                b = false;
            }
            if ($("#MainContent_txt_m2").val() == "") {
                b = false;
            }
            if ($("#MainContent_txt_m1_s").val() == "") {
                b = false;
            }
            if ($("#MainContent_txt_m2_s").val() == "") {
                b = false;
            }
            if (!b) {
                alert("请完整输入参数。");
            }
            return b;
        }

        //根据检测次数 打开新窗体
        function OpenIframe(RawID, FoodTime, FoodNum) {
            window.location.href = 'WaterEdit.aspx?RawID=' + RawID + "&FoodTime=" + FoodTime + "&FoodNum=" + FoodNum + "&rid=" + Math.random();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="TitleTabs">
        <ul>
            <li><a class="<%=Request.QueryString["FoodNum"].ToString()=="1"?"TabsOver":""%>" href="javascript:OpenIframe('<%=Request.QueryString["RawID"].ToString()%>','<%=Request.QueryString["FoodTime"].ToString()%>',1);">第一次检测</a></li>
            <li><a class="<%=Request.QueryString["FoodNum"].ToString()=="2"?"TabsOver":""%>" href="javascript:OpenIframe('<%=Request.QueryString["RawID"].ToString()%>','<%=Request.QueryString["FoodTime"].ToString()%>',2);">第二次检测</a></li>
            <li><a class="<%=Request.QueryString["FoodNum"].ToString()=="3"?"TabsOver":""%>" href="javascript:OpenIframe('<%=Request.QueryString["RawID"].ToString()%>','<%=Request.QueryString["FoodTime"].ToString()%>',3);">第三次检测</a></li>
        </ul>
    </div>
    <div style="width:800px;padding-top:20px;">
        <table border="0" cellpadding="0" cellspacing="0" width="98%" style=" margin:0px auto;">
            <tr>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td style="width:130px;">含水量（mg/100g）:</td>
                            <td colspan="3"><asp:TextBox style="width:260px;" ID="txt_content" runat="server" CssClass="text ui-widget-content ui-corner-all" Enabled="false"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="right">m1:</td><td><asp:TextBox style="width:100px;" ID="txt_m1" runat="server" CssClass="text ui-widget-content ui-corner-all"></asp:TextBox></td>
                            <td width="50px" align="right">m2:</td><td><asp:TextBox style="width:100px;" ID="txt_m2" runat="server" CssClass="text ui-widget-content ui-corner-all"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="right">m3:</td><td colspan="2"><asp:TextBox style="width:100px;" ID="txt_m1_s" runat="server" CssClass="text ui-widget-content ui-corner-all"></asp:TextBox></td>
                        </tr>
                    </table>
                </td>
                <td valign="top">
                    式中：<br />
                    X —式样中水分的含量，单位为克（g/100g）；<br />
                    m1—称量瓶（加海砂、棒）和式样的质量，单位为克（g）；<br />
                    m2—称量瓶（加海砂、棒）和式样干燥后的质量，单位为克（g）；<br />
                    m3—称量瓶（加海砂、棒）的质量，单位为（g）；<br />
                    水分含量≥1g/100g时，计算结果保留三位有效数字；<br />
                    水分含量<1g/100g时，结果保留两位有效数字；<br />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    含水量计算公式：X(含数量)=(m1-m2)/(m1-m3)×100
                </td>
            </tr>
        </table>
    </div>
    <div class="aui_buttons">
            <div class="Mean">
                平均值：<asp:Label ID="labMean" runat="server" Text=""></asp:Label>
            </div>
            <asp:Button Text="提交" runat="server" CssClass="aui_state_highlight" ID="btPost" OnClientClick="return IsNotNull()" OnClick="btPost_Click"/>
            <asp:Button Text="计算平均值" runat="server" CssClass="aui_state_highlight" ID="btnMean" onclick="btnMean_Click" />
        </div>
    </form>
</body>
</html>
